package com.ctrip.ec.api.admin.common;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Created by cannon on 2018/3/26.
 */
public class ResultBody<T> {


    public final int code;
    public final String msg;
    public final T data;
    public final long count;

    @JsonCreator
    public ResultBody(@JsonProperty("code") int code,
                      @JsonProperty("msg") String msg,
                      @JsonProperty("data") T data) {
        this(code,msg,data,-1);
    }

    public ResultBody(@JsonProperty("status") int code,
                      @JsonProperty("message") String msg,
                      @JsonProperty("res") T data,
                      @JsonProperty("count") long count) {

        this.code = code;
        this.msg = msg;
        this.data = data;
        this.count = count;
    }
}